#ifndef _INCLUDE_BUFFER_H
#define _INCLUDE_BUFFER_H

#define B_L 1024
//template<int B_L=1024>
class CLoopBuffer
{
public:
	CLoopBuffer();
	~CLoopBuffer();

private:
	unsigned char _buf[B_L];
	unsigned int _head;
	unsigned int _foot;
public:
	void Reset();
	bool Add(const unsigned char* pSrc, int nCount);
	const unsigned char* GetBuffer();
	unsigned int GetCapacity();
	unsigned int GetPayload_NoRollBack();
	unsigned int GetPayload();
	bool ResetPayload(unsigned int nResetCount);
};

//template<int B_L=1024>
class CEasyBuffer
{
public: 
	CEasyBuffer();
	~CEasyBuffer();
private:
	unsigned char _buf[B_L];
	unsigned int _curIdx;
public:
	bool Add(const unsigned char* pSrc, int nCount);
	const unsigned char* GetBuffer();
	unsigned int GetCapacity();
	unsigned int GetPayload();
	void ResetPayload(unsigned int nResetCount);

};

#endif